package com.api.common.alert.model;


import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

@Getter
public enum AlertTypeEnums {

    EMAIL("邮件","email"),
    DINGTALK("邮件","dingtalk");

    private  final String name;
    private final String type;

    AlertTypeEnums(String name, String type) {
        this.name=name;
        this.type=type;
    }


    public static AlertTypeEnums getEnums(String type){
        if(StringUtils.isBlank(type))
            throw new RuntimeException("类型为空");
        for (AlertTypeEnums value : values()) {
            if(value.getType().equals(type)){
                return value;
            }
        }
        return null;
    }

}
